package com.atguigu.flink.chapter5.source;


import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * @Author lizhenchao@atguigu.cn
 * @Date 2020/12/19 11:26
 */
public class Flink01_Source_Collection {
    public static void main(String[] args) throws Exception {
       StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        env.setParallelism(1);
//        List<Integer> list = Arrays.asList(1, 10, 100, 100);
//        DataStreamSource<Integer> ds = env.fromCollection(list);

        DataStreamSource<Integer> ds = env.fromElements(10, 100, 100, 1000);
        ds.print();


        env.execute();
    }

}
